home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 2
/
Apprentice-Release2.iso
/
Tools
/
MPW
/
flex 2.4.6
/
MISC
/
fastwc
/
wc1.l
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1994-01-10
|
247 b
|
19 lines
|
[
TEXT/MPS
]
/* First cut at a flex-based "wc" tool. */
ws [ \t]
nonws [^ \t\n]
%%
int cc = 0, wc = 0, lc = 0;
{nonws}+ cc += yyleng; ++wc;
{ws}+ cc += yyleng;
\n ++lc; ++cc;
<<EOF>> {
printf( "%8d %8d %8d\n", lc, wc, cc );
yyterminate();
}